<%@ page language="java" pageEncoding="utf8"%>
<jsp:include page="/head_admin.jsp" />
<script type="text/javascript" src="./script/orderManager.js"></script>
<script type="text/javascript">
		dojo.addOnLoad(function(){
		//	BookManager.loadAllBooks();
			//var bookTicketsAEle =  document.getElementById("a_bookTickets");
  			//bookTicketsAEle.className = "active";
			OrderManager.askForAllOrders();
			dijit.byId("orderGrid").resize();
		});
		
		var allOrders = {
        	items:[]
    	};
    	
		var orderStore = new dojo.data.ItemFileWriteStore({data:allOrders});
		
		function deleteOrder(orderId) {
			if(confirm("确认删除该订单？")==true) {
				var href = "orderManager.do?method=deleteOrder&orderid="+orderId;
				ajaxRequest(href, this.deleteOrderInGrid, null);
			}
		}
		
		function deleteOrderInGrid(ajax_request) {
			var item = dijit.byId("orderGrid").removeSelectedRows();
			orderStore.deleteItem(item);
		}
</script>
<style type="text/css">
	#orderGrid{
		min-height:300px;
		width:100%;
	}
	.dojoxGrid table {
        margin: 0;
        font-size: 12px;
        text-align: center;
    }
</style>


<div class="maincontent">
	<div class="HackBox"></div>
	<div id="breadcrumb">
		&nbsp;
		订单管理
	</div>

	<div class="maincontentin">
		<div class="movieRoomDiv" style="height: 424px;">
			<div id="adminGridDiv">
				<table dojoType="dojox.grid.DataGrid" id="orderGrid" selectionMode="single" autoHeight="true" 
				 style="background:white" store="orderStore">
					<thead>
						<tr>
							<th field="userId" width="10%">用户名</th>
							<th field="movieName" width="20%">电影名</th>
							<th field="sessionDate" width="20%">场次</th>
							<th field="orderPrice" width="10%">票价</th>
							<th field="orderQuantity" width="10%">票数</th>
							<th field="seatNos" width="20%">座位</th>
							<th field="deleteOrder" width="10%">删除</th>
						</tr>
					</thead>
				</table>
			</div>
		</div>
	</div>
	<!-- main content -->
</div>

<jsp:include page="footer.jsp" />